//---------------------------------------------------------------------------

#ifndef FirmSearchDlgH
#define FirmSearchDlgH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <DBGrids.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include <ToolWin.hpp>
#include <Db.hpp>
#include <DBTables.hpp>
#include <Buttons.hpp>

#include "GlassesBridge.h"


//---------------------------------------------------------------------------
class TfrmFirmSearchDlg : public TForm
{
__published:	// IDE-managed Components
        TPanel *pnlMain;
        TLabel *lblName;
        TStringGrid *grdFirms;
        TBitBtn *btnHelp;
        TEdit *edtName;
        TButton *btnFind;
        TButton *btnClear;
        TBitBtn *btnOk;
        TBitBtn *btnCancel;
        void __fastcall FormShow(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall btnCloseClick(TObject *Sender);
        void __fastcall btnClearClick(TObject *Sender);
        void __fastcall btnFindClick(TObject *Sender);
        void __fastcall btnOkClick(TObject *Sender);
        void __fastcall btnCancelClick(TObject *Sender);
private:
        TDatabase * dbMain;
        TGlassesBridge* bridge;
        TStringList *firms;
        TGlassesFirm* selectedFirm;

        void RefreshGrid();
public:
        __fastcall TfrmFirmSearchDlg(TComponent* Owner, TDatabase * dbMain, TGlassesBridge* bridge, TGlassesFirm* selectedFirm);
};
//---------------------------------------------------------------------------
#endif
